﻿using EyFramework.Sys.Entity;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EyFramework.Task.Entity;
using Newtonsoft.Json;

namespace EyFramework.Task.Excutor
{
    public class ExeJobExecutor : IJobExecutor
    {
        public ReturnData Execute(QrtzCsTask pTaskInfo)
        {
            ReturnData rd = new ReturnData();
            ExeFileInfo efi = JsonConvert.DeserializeObject<ExeFileInfo>(pTaskInfo.TASK_INFO);
            try
            {
                Process proc = Process.Start(efi.EXE_NAME, efi.EXE_ARGS);
            }
            catch (Exception ex)
            {
                rd.Fail("调用Exe任务失败！" + ex.Message);
            }
            return rd;
        }
    }
}